<script setup>
import { useRoute } from 'vue-router'

const route = useRoute()
</script>

<template>
  <div class="layout">
    <header class="header">
      <div class="header-content">
        <h1 class="logo">超级无敌嘎嘎权威应当的多民族社保政务平台</h1>
      </div>
    </header>
    
    <main class="main">
      <div class="container">
        <nav class="nav">
          <router-link to="/enrollment/register" class="nav-link" :class="{ active: route.path === '/enrollment/register' }">
            参保登记
          </router-link>
          <router-link to="/enrollment/query" class="nav-link" :class="{ active: route.path === '/enrollment/query' }">
            参保查询
          </router-link>
          <router-link to="/units" class="nav-link" :class="{ active: route.path === '/units' }">
            单位管理
          </router-link>
        </nav>
        <router-view />
      </div>
    </main>
  </div>
</template>

<style scoped>
.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 64px;
}

.logo {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  gap: 24px;
  margin-bottom: 0;
  padding: 0 0 16px 0;
}

.nav-link {
  color: var(--primary-blue);
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 2px solid transparent;
  font-size: 18px;
}

.nav-link:hover {
  color: var(--primary-blue-dark);
  background: rgba(25, 118, 210, 0.1);
  border-color: rgba(25, 118, 210, 0.2);
}

.nav-link.active {
  color: white;
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

.main {
  flex: 1;
  padding: 24px 0 0 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 768px) {
  .header-content {
    height: auto;
    padding: 16px 20px;
  }
  
  .logo {
    font-size: 20px;
    line-height: 1.4;
  }
  
  .nav {
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .nav-link {
    padding: 8px 16px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 16px;
  }
  
  .nav {
    gap: 8px;
  }
  
  .nav-link {
    padding: 6px 12px;
    font-size: 15px;
  }
}
</style>
